package com.magenta.maxoptra.gis.distancematrix;

/**
 * @author Sergey Grachev
 */
public enum CommandType {

    STOP(10.1f),
    EVENTS_UNSUBSCRIBE(10.2f),
    EVENTS_SUBSCRIBE(10.3f),

    CHANGE_GEO_PROVIDER_SETTINGS(20.1f),
    CHANGE_REQUESTS_INTERVAL(20.2f),
    CHANGE_UPDATE_TIME_INTERVAL(20.3f),

    REMOVE_COORDINATES(30.1f),
    ADD_COORDINATES(30.2f),

    SYNCHRONIZE_MATRICES(40.1f),
    FORCE_MATRIX_UPDATE(40.2f),

    START(50.1f);

    private final float priorityOrder;

    private CommandType(final float priorityOrder) {
        this.priorityOrder = priorityOrder;
    }

    /**
     * Priority of command, less is more important. Used by
     * {@link com.magenta.maxoptra.gis.DistanceMatrixService#scheduleForExecute(java.util.List, boolean) scheduleForExecute}
     *
     * @return order
     */
    public float getPriorityOrder() {
        return priorityOrder;
    }
}
